#include "Cmaid_Gtest.h"

TEST(Cmaid_Iter_Empty, attach)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, current)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_current(&iter));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, next)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_next(&iter));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, previous)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_previous(&iter));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, container_get)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_container_get(&iter));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, index_get)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_GT(0, cmaid_iter_index_get(&iter));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, p_goto)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_goto(&iter, (void *)1));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, iter_goto)
{
	Cmaid_Iter iter1 __CMAID_CHECKED_ITER__;
	Cmaid_Iter iter2 __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter1);
	cmaid_iter_empty_attach(&iter2);

	ASSERT_TRUE(NULL == cmaid_iter_iter_goto(&iter1, &iter2));
	cmaid_iter_empty_detach(&iter1);
	cmaid_iter_empty_detach(&iter2);
}

TEST(Cmaid_Iter_Empty, index_goto)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_index_goto(&iter, 0));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, start)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);
	cmaid_iter_start(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_current(&iter));
	cmaid_iter_empty_detach(&iter);
}

TEST(Cmaid_Iter_Empty, remove)
{
	Cmaid_Iter iter __CMAID_CHECKED_ITER__;

	cmaid_iter_empty_attach(&iter);
	cmaid_iter_remove(&iter);

	ASSERT_TRUE(NULL == cmaid_iter_current(&iter));
	cmaid_iter_empty_detach(&iter);
}
